IdeaBlade.EntityModel.Compat Assembly > IdeaBlade.EntityModel.Compat Namespace > EntityScalarQueryAsyncExtensions Class > Single Method : Single(IEntityScalarQuery,IPredicateDescription,Action<EntityScalarQueryOperation>,Object) Method |
'Declaration
<ExtensionAttribute()> Public Overloads Shared Function Single( _ ByVal source As IEntityScalarQuery, _ ByVal predicateDescription As IPredicateDescription, _ ByVal userCallback As Action(Of EntityScalarQueryOperation), _ Optional ByVal userState As Object _ ) As EntityScalarQueryOperation
'Usage
Dim source As IEntityScalarQuery Dim predicateDescription As IPredicateDescription Dim userCallback As Action(Of EntityScalarQueryOperation) Dim userState As Object Dim value As EntityScalarQueryOperation value = EntityScalarQueryAsyncExtensions.Single(source, predicateDescription, userCallback, userState)
public void AsyncSingleWithPredicate() { var op = _entityManager.Employees.AsScalarAsync().Single(e => e.Id == 1); op.Completed += (o, e) => { var emp = e.Result; }; }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2